package com.immunology.service;

import java.util.List;

import com.immunology.dao.SyndromeDao;
import com.immunology.database.transformers.SyndromeTransformer;
import com.immunology.model.Syndrome;

public class SyndromeService {

	private static SyndromeService syndromeService = null;
	private SyndromeDao syndromeDao = new SyndromeDao(new SyndromeTransformer());

	private SyndromeService() {
	}

	public static SyndromeService getInstance() {
		if (syndromeService == null) {
			syndromeService = new SyndromeService();
		}
		return syndromeService;
	}

	public void insert(String syndromeName) {
		Syndrome syndrome = new Syndrome();
		syndrome.setName(syndromeName);
		syndromeDao.insert(syndrome);
	}

	public void delete(int syndromeId) {
		syndromeDao.delete(syndromeId);
	}
	
	public void update(int syndromeId,Syndrome syndrome) {
		syndromeDao.update(syndromeId, syndrome);
	}

	public List<Syndrome> getSyndromeList() {
		return syndromeDao.getAll();
	}

	public Syndrome getSyndromeById(int syndromeId) {
		return syndromeDao.getById(syndromeId);
	}

}
